import vue from 'vue'
import ComfirmDialog from './index.vue'

const ComfirmConstructor = vue.extend(ComfirmDialog)

function comfirmToast(params) {
  const comfirmDom = new ComfirmConstructor({
    el: document.createElement('div'),
    data() {
      return {
        params: params // 接收的参数
      }
    }
  })
  document.body.appendChild(comfirmDom.$el)
}

function $comfirmDialog() {
  vue.prototype.$comfirmDialog = comfirmToast
}

export default $comfirmDialog
